home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_q_t
/
trem.zip
/
INIT.C
< prev
next >
Wrap
Text File
|
1991-05-11
|
3KB
|
103 lines
/************************************************************************
*
* Copyright (c) 1991 Microsoft Corporation. All Rights Reserved.
*
*-----------------------------------------------------------------------
*
* Project: Windows Terminal Example
*
* Module: init.c
*
* Author: Bryan A. Woodruff (baw)
*
*
* Remarks: Initialization routines
*
* Revisions:
* 01.00.000 5/ 9/91 baw Wrote it
*
************************************************************************/
#include "terminal.h"
/************************************************************************
* BOOL InitApplication( HANDLE hInstance )
*
* Description:
* First time initialization stuff. This registers information
* such as window classes.
*
* Comments:
* 5/ 8/91 baw Wrote it
*
************************************************************************/
BOOL InitApplication( HANDLE hInstance )
{
WNDCLASS wndclass ;
// register terminal window class
wndclass.style = NULL ;
wndclass.lpfnWndProc = TerminalWndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = sizeof( WORD ) ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon( hInstance, szAppName ) ;
wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ) ;
wndclass.hbrBackground = GetStockObject( WHITE_BRUSH ) ;
wndclass.lpszMenuName = szTerminalMenu ;
wndclass.lpszClassName = szTerminalClass ;
return( RegisterClass( &wndclass ) ) ;
} /* end of InitApplication() */
/************************************************************************
* BOOL InitInstance( HANDLE hInstance, int nCmdShow, HWND *phwndApp )
*
* Description:
* Initializes instance specific information.
*
* Comments:
* 5/ 8/91 baw Wrote it
*
************************************************************************/
BOOL InitInstance( HANDLE hInstance, int nCmdShow, HWND *phwndApp )
{
HWND hwndApp ;
// store instance handle
hAppInst = hInstance ;
// store version number
wsprintf( szVersion, "%02d.%02d.%03d", VER_MAJOR, VER_MINOR, VER_BUILD ) ;
// load accelerators
hAccel = LoadAccelerators( hInstance, szTerminalAccel ) ;
// create the Terminal window
hwndApp = CreateWindow( szTerminalClass, szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL ) ;
if (NULL == hwndApp)
return ( FALSE ) ;
ShowWindow( hwndApp, nCmdShow ) ;
UpdateWindow( hwndApp ) ;
*phwndApp = hwndApp ;
return ( TRUE ) ;
} /* end of InitInstance() */
/************************************************************************
* End of File: init.c
************************************************************************/